#include <memory.h>
#include "Reactor.hpp"
#include "Connection.hpp"
#include "Listener.hpp"
#include "Log.hpp"

using namespace LogModule;

int main(int argc, char* argv[])
{
	ENABLE_CONSOLE_LOG();
	if(argc != 2)
	{
		std::cout << "Usage: " << argv[0] << " port" << std::endl;
		return 1;
	}
	uint16_t port = std::stoi(argv[1]);
	Reactor reactor;
	auto conn = std::make_shared<Listener>(port);
	reactor.insertConnection(conn);
	reactor.Loop();

	return 0;
}